package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.GunInoutRecordMapper;
import com.zone.service.domain.GunInoutRecord;
import com.zone.service.domain.GunSummary;
import com.zone.service.service.IGunInoutRecordService;

/**
 * 枪弹出入流水Service业务层处理
 * 
 * @author ningbo
 * @date 2025-11-18
 */
@Service
public class GunInoutRecordServiceImpl implements IGunInoutRecordService 
{
    @Autowired
    private GunInoutRecordMapper gunInoutRecordMapper;

    /**
     * 查询枪弹出入流水
     * 
     * @param id 枪弹出入流水主键
     * @return 枪弹出入流水
     */
    @Override
    public GunInoutRecord selectGunInoutRecordById(String id)
    {
        return gunInoutRecordMapper.selectGunInoutRecordById(id);
    }

    /**
     * 查询枪弹出入流水列表
     * 
     * @param gunInoutRecord 枪弹出入流水
     * @return 枪弹出入流水
     */
    @Override
    public List<GunInoutRecord> selectGunInoutRecordList(GunInoutRecord gunInoutRecord)
    {
        return gunInoutRecordMapper.selectGunInoutRecordList(gunInoutRecord);
    }

    @Override
    public List<GunSummary> selectSummaryList(GunSummary query) {
        return gunInoutRecordMapper.selectSummaryList(query);
    }

    /**
     * 新增枪弹出入流水
     * 
     * @param gunInoutRecord 枪弹出入流水
     * @return 结果
     */
    @Override
    public int insertGunInoutRecord(GunInoutRecord gunInoutRecord)
    {
        gunInoutRecord.setCreateTime(DateUtils.getNowDate());
        return gunInoutRecordMapper.insertGunInoutRecord(gunInoutRecord);
    }

    /**
     * 修改枪弹出入流水
     * 
     * @param gunInoutRecord 枪弹出入流水
     * @return 结果
     */
    @Override
    public int updateGunInoutRecord(GunInoutRecord gunInoutRecord)
    {
        gunInoutRecord.setUpdateTime(DateUtils.getNowDate());
        return gunInoutRecordMapper.updateGunInoutRecord(gunInoutRecord);
    }

    /**
     * 批量删除枪弹出入流水
     * 
     * @param ids 需要删除的枪弹出入流水主键
     * @return 结果
     */
    @Override
    public int deleteGunInoutRecordByIds(String[] ids)
    {
        return gunInoutRecordMapper.deleteGunInoutRecordByIds(ids);
    }

    /**
     * 删除枪弹出入流水信息
     * 
     * @param id 枪弹出入流水主键
     * @return 结果
     */
    @Override
    public int deleteGunInoutRecordById(String id)
    {
        return gunInoutRecordMapper.deleteGunInoutRecordById(id);
    }
}
